<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>期末考试</title>
</head>
<body>
    <form action="">
        <label for="stu_id">学号：<input type="text" id="stu_id"></label><br>
        <label for="stu_name">姓名：<input type="text" id="stu_name"></label><br>
        <label for="chinese">语文：<input type="text" id="chinese"></label><br>
        <label for="math">数学：<input type="text" id="math"></label><br>
        <label for="english">英语：<input type="text" id="english"></label><br>
        <label for="lizong">理综：<input type="text" id="lizong"></label><br>
        <label for="wenzong">文综：<input type="text" id="wenzong"></label><br>
        <button class="btn">提交信息</button>
    </form>
    <script src="../jquery/jquery-1.12.4.min.js"></script>
    <script>
        $(".btn").click((e)=>{
            e.preventDefault;
            $.ajax({
                method:"post",
                url:"http://localhost:3000/end_exam",
                data:{
                    stu_id:$("#stu_id").val(),
                    stu_name:$("#stu_name").val(),
                    chinese:$("#chinese").val(),
                    math:$("#math").val(),
                    english:$("#english").val(),
                    lizong:$("#lizong").val(),
                    wenzong:$("#wenzong").val()
                },
                success:(data)=>{
                    console.log(data);
                },
                error:(err)=>{
                    console.log(err);
                }
            })
        })
    </script>
</body>
</html>